package ticket;

import ticket.discount.DiscountStrategy;

public class MovieTicket {

    private double originalPrice;

    private double discountPrice;

    private DiscountStrategy discountStrategy;

    public double discountCalculate (){
        //调用打折策略类的计算方法
        this.discountPrice =
                discountStrategy.calculate(this.originalPrice);

        return discountPrice;
    }


    public void setDiscountStrategy(DiscountStrategy discountStrategy) {
        this.discountStrategy = discountStrategy;
    }

    public double getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(double originalPrice) {
        this.originalPrice = originalPrice;
    }

    public double getDiscountPrice() {
        return discountPrice;
    }



    public DiscountStrategy getDiscountStrategy() {
        return discountStrategy;
    }


}
